package org.fujay.langchain4jserver.domain.conversation.vo;

import cn.hutool.core.util.IdUtil;
import org.springframework.util.Assert;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户ID值对象
 */
public record UserId(Long value) implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    public UserId {
        Assert.notNull(value, "User ID cannot be empty");
    }

    public static UserId create() {
        return new UserId(IdUtil.getSnowflakeNextId());
    }
}
